Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missed an IE mention / centering using margin #34174

Merged
merged 2 commits into from
Jun 20, 2024
Merged

Conversation

estelle
Copy link
Member

@estelle estelle commented Jun 14, 2024

No description provided.

@estelle estelle requested a review from a team as a code owner June 14, 2024 23:00
@estelle estelle requested review from dipikabh and removed request for a team June 14, 2024 23:00
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed labels Jun 14, 2024
Copy link
Contributor

github-actions bot commented Jun 14, 2024

Preview URLs

(comment last updated: 2024-06-20 18:46:58)


However, in older browsers like IE8-9 that do not support Flexible Box Layout, these are not available. In order to center an element inside its parent, use `margin: 0 auto;`.
More commonly, though, people horizontally center element by setting {{cssxref("display")}}`: flex;` {{cssxref("justify-content")}}`: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • How about the phrasing below (we can drop "to center an element horizontally" to avoid it repetition from the previous para)
  • The quotes after the cssxref are adding an extra space before the ":". We can either remove the cssxref or link the entire property value pair.
Suggested change
More commonly, though, people horizontally center element by setting {{cssxref("display")}}`: flex;` {{cssxref("justify-content")}}`: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children.
A more common method to center an element horizontally is by setting `display: flex;` and `justify-content: center;` on a container, which [centers its flex item](/en-US/docs/Web/CSS/CSS_flexible_box_layout/Aligning_items_in_a_flex_container) children.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used your suggestion, and linked justify-content

@estelle estelle requested a review from dipikabh June 20, 2024 18:46
Copy link
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@dipikabh dipikabh merged commit 7016e37 into main Jun 20, 2024
9 checks passed
@dipikabh dipikabh deleted the estelle-patch-2-1 branch June 20, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants